package com.niit.huodong1;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;

import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;

import java.io.IOException;


public class NIITEmployeeMain {
    public static void main(String[] args) throws IOException,ClassNotFoundException,InterruptedException

    {
        Job job = Job.getInstance(new Configuration());
        job.setMapperClass(NIITEmployeeMapper.class);
        job.setMapOutputKeyClass(IntWritable.class);
        job.setMapOutputValueClass(NIITEmployee.class);
        job.setOutputKeyClass(IntWritable.class);
        job.setOutputValueClass(NIITEmployee.class);
        FileInputFormat.setInputPaths(job,new Path("D:/employee.txt"));
        FileOutputFormat.setOutputPath(job,new Path("D:/EmployeeSer12/"));
        boolean completion = job.waitForCompletion(false);
        if (completion)
            System.out.println("Success!!");
        else
            System.out.println("Failed");
    }
}
